import { createRouter,createWebHistory } from 'vue-router'


  const router = createRouter({
    history: createWebHistory(),//设置路由模式
    routes: [
      {
        path: '/home',
        component: () => import('../components/pages/Home.vue')
      }
      ,
      {
        path: '/hospital',
        component: () => import('../components/pages/Hospital.vue'),
        children: [
          {
            path: 'check',
            component: ()=>import('../components/hospital_detail/Check.vue'),
          },
          {
            path: 'detail',
            component: ()=>import('../components/hospital_detail/Detail.vue'),
          },
          {
          path: 'info',
          component: ()=>import('../components/hospital_detail/Info.vue'),
          },
          {
            path: 'register',
            component: ()=>import('../components/hospital_detail/Register.vue'),
          },
          {
            path: 'booking',
            component: ()=>import('../components/hospital_detail/Booking.vue'),
          },
        ]
      },
      {
        path: '/',
        redirect:'/home'
      }
      ,
      // 跳转404界面
      {
        path: '/404',
        component:()=>import('../components/pages/NoPage.vue')
      }
      ,
      {
        path: '/:pathMatch(.*)',
        redirect:'/404'
      }
    ]
  })
   
  export default router